Ext.define('Service.user.view.UserDataListGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.Service_user_view_UserDataListGrid',
	border : false,
    title: '',
    forceFit : true,
    frame : false,
    layout : 'fit',
	columnLines : true,
	loadMask : true,
	
	viewConfig : {
		stripeRows : true
	},

    initComponent: function() {
        var me = this;
		me.store = Ext.create('Service.user.store.UserDataListStore');
        Ext.applyIf(me, {
            columns: [
                  {
                      xtype: 'numbercolumn',
                      dataIndex: 'id',
                      text: '用户ID',
                      format : '0,000',
                      sortable : true
                  },
                  {
                      xtype: 'gridcolumn',
                      dataIndex: 'userName',
                      text: '用户名',
                      editor:{
                    	  allowBlank:false
                      },
                      sortable : true
                  },
                  {
                      xtype: 'gridcolumn',
                      dataIndex: 'realName',
                      text: '真实姓名',
                      editor:{
                    	  allowBlank:false
                      },
                      sortable : true
                  },
                  {
                      xtype: 'gridcolumn',
                      dataIndex: 'tel',
                      text: '电话',
                      editor:{
                    	  allowBlank:true,
                    	  regex: /^\d+$/,
		                  regexText: '电话只能输入数字'
                      },
                      sortable : false
                  },
                  {
                      xtype: 'datecolumn',
                      dataIndex: 'createTime',
                      text: '创建时间',
                      sortable : true,
                      format : 'Y-m-d'
                  },
                  {
                      xtype: 'datecolumn',
                      dataIndex: 'updateTime',
                      text: '修改时间',
                      sortable : true,
                      format : 'Y-m-d'
                  },
                  {
                      xtype: 'gridcolumn',
                      dataIndex: 'createUserName',
                      text: '创建人',
                      sortable : false
                  },
                  {
                      xtype: 'gridcolumn',
                      dataIndex: 'updateUserName',
                      text: '修改人',
                      sortable : false
                  }
              ],
            selModel: Ext.create('Ext.selection.CheckboxModel', {}),
            bbar : {
                xtype: 'cnpbar',
                store : me.store
			},
            dockedItems: [
                {
                    xtype: 'toolbar',
                    dock: 'top',
                    items: [
                        {
                            xtype: 'button',
                            width: 80,
                            icon : Constants.SER_RES_PATH + 'icon/share/user_add.gif',
                            text: '添加用户',
                            module: 'Service_user',
                            action: 'addUser',
                            id: 'Service_user_btn_show_UserAddWindow'
                        },
                        '-',
                        {
                            xtype: 'button',
                            width: 80,
                            icon : Constants.SER_RES_PATH + 'icon/share/user_edit.png',
                            text: '修改用户',
                            module: 'Service_user',
                            action: 'chgUser',
                            id: 'Service_user_btn_show_UserChgWindow'
                        },
                        '-',
                        {
                            xtype: 'button',
                            width: 80,
                            icon : Constants.SER_RES_PATH + 'icon/share/user_delete.gif',
                            text: '批量删除',
                            module : 'Service_user',
                            action : 'delUsers',
                            id: 'Service_user_btn_batchDel_Users'
                        },
                        '->',
                        {
                            xtype: 'textfield',
                            padding: '',
                            fieldLabel: '',
                            emptyText: '输入搜索条件'
                        },
                        {
                            xtype: 'button',
                            width: 23,
                            height : 21,
                           	cls : 'ux-search-btn',
                           	overCls : 'ux-search-btn-over'
                        }
                    ]
                }
            ]
        });
 		me.store.loadPage(1,{});
        me.callParent(arguments);
    }

});